﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Net.Mail;
using Actuals.CoreDomain;
using Actuals.CoreDomain.Business;


namespace Actuals.Business
{
    public class BusinessEmail : IBusinessEmail
    {


        public void SendEmail(IEmail email)
        {
            SmtpClient smtp = new SmtpClient();
            MailAddress from = new MailAddress(email.From, email.From);
            MailAddress to = new MailAddress(email.To, email.To);
            MailMessage message = new MailMessage(from, to);
            message.Subject = email.Subject;
            message.Body = email.Body;
            message.From = from;
            message.To.Add(to);
            message.IsBodyHtml = true;
            smtp.Send(message);

        }
    }
}
